
import 'dart:convert';

Assessment liveAssessmentFromJson(String str) => Assessment.fromJson(json.decode(str));

String liveAssessmentToJson(Assessment data) => json.encode(data.toJson());

class Assessment {
    Assessment({
        this.classId,
        this.kind,
        this.instruction,
        this.audioType,
        this.name,
        this.textType,
        this.className,
        this.questionGroup,
        this.id,
        this.endTime,
        this.type,
        this.status,
    });

    String? classId;
    dynamic kind;
    dynamic instruction;
    String? audioType;
    String? name;
    String? textType;
    String? className;
    QuestionGroup? questionGroup;
    String? id;
    int? endTime;
    String? type;
    String? status;

    factory Assessment.fromJson(Map<String, dynamic> json) => Assessment(
        classId: json["classId"],
        kind: json["kind"],
        instruction: json["instruction"],
        audioType: json["audioType"],
        name: json["name"],
        textType: json["textType"],
        className: json["className"],
        questionGroup: json["questionGroup"]!=null ? QuestionGroup.fromJson(json["questionGroup"]) : null,
        id: json["id"],
        endTime: json["endTime"],
        type: json["type"],
        status: json["status"],
    );

    Map<String, dynamic> toJson() => {
        "classId": classId,
        "kind": kind,
        "instruction": instruction,
        "audioType": audioType,
        "name": name,
        "textType": textType,
        "className": className,
        "questionGroup": questionGroup!=null ? questionGroup?.toJson() : null,
        "id": id,
        "endTime": endTime,
        "type": type,
        "status": status,
    };
}

class QuestionGroup {
  QuestionGroup({
    this.level,
    this.imageLink,
    this.id,
    this.title,
    this.bookId,
  });

  int? level;
  String? imageLink;
  String? id;
  String? title;
  String? bookId;

  factory QuestionGroup.fromJson(Map<String, dynamic> json) => QuestionGroup(
        level: json["level"],
        imageLink: json["imageLink"],
        id: json["id"],
        title: json["title"],
        bookId: json["bookId"],
      );

  Map<String, dynamic> toJson() => {
        "level": level,
         "imageLink": imageLink,
        "id": id,
        "title": title,
        "bookId": bookId,
      };
}
